import express from "express";
import {ArticleService} from "../domain/article/ArticleService";
import {Menu} from "../domain/article/Menu";
import {Response} from "./Response"

const router = express.Router();
const articleService = new ArticleService();

/**
 * 获取data下的目录的文章
 * 结构为 data/dir/article/xxxx.md
 * 以分页的形式返回
 */
router.post("/dir", function (req, res) {
    let rootMenu = new Menu();
    rootMenu.path = "/";
    rootMenu.name = "";
    let articles = articleService.getArticles(rootMenu);
    res.json(Response.successWithData(articles));
});

/**
 * 获取文章详细信息
 */
router.post("/dir/article", function (req, res){



})

export {router as articleRouter};
